package ioperation;

import book.Book;
import book.BookList;
import exception.ShowException;

public class ShowOperation implements IOperation {
    @Override
    public void work(BookList bookList) throws ShowException {

        if(bookList.getUsedsize()==0){
            throw new ShowException("书架为空......");
        }

        for (int i = 0; i < bookList.getUsedsize(); i++) {
            Book book = bookList.getBook(i);
            System.out.println(book.toString());
        }
        System.out.println("已显示所有图书");
    }
}

